Skip to content

cmake: don't auto vectorize with AltiVec on PPC #13321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

techflashYT
Copy link

Description

Allowing GCC/Clang to auto-vectorize with AltiVec support breaks support for non-AltiVec compatible processors. Adding this option allows the existing AltiVec specific code to function as it always did, but prevents the compiler from inserting AltiVec instructions into arbitrary codepaths that SDL can't gate off via the existing CPUInfo code.

Existing Issue(s)

None found.

Allowing GCC/Clang to auto-vectorize with AltiVec support breaks support
for non-AltiVec compatible processors.  Adding this option allows the
existing AltiVec specific code to function as it always did, but
prevents the compiler from inserting AltiVec instructions into arbitrary
codepaths that SDL can't gate off via the existing CPUInfo code.
@sezero sezero requested review from icculus and slouken July 5, 2025 09:14
@icculus
Copy link
Collaborator

icculus commented Jul 5, 2025

Hmm...I think this is probably okay, because it fits the spirit of what that piece of CMake code is trying to do, and historically we've had to deal with (Apple) computers that might or might not have AltiVec support.

But for systems with guaranteed AltiVec units, we probably do want the compiler to use those instructions wherever it can, even just in basic for-loops outside of the blitters. Unlike the Mac, I assume most PowerPC systems are special case devices that you build specific binaries for.

So I think merge this, but let's add a FIXME to maybe adjust this at some point.

@slouken slouken added this to the 3.4.0 milestone Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants